<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container{
            width: 500px;
            display: flex;
            justify-content: space-around;
            border: 10px solid lightblue;
            padding: 20px;
            margin: 100px auto;
            position: relative;
        }
        .container>img{
            width: 150px;
        }
        .box{
            display: none;
            position: absolute;
            left: 0;
            top: 150px;

        }
    </style>
</head>
<body>
    <div class="container">
        <img src="./images/1.png" alt="" >
        <img src="./images/2.png" alt="">
        <img src="./images/3.png" alt="">
        <div class="box">
            <img src="./images/1.png" alt="">
        </div>
    </div>
</body>
</html>
<script src='https://code.jquery.com/jquery-3.6.0.min.js'></script>
<script>
    $('.container>img').mouseover(function(){
        $(this).parent().find('div').fadeIn();
        let s=$(this).attr('src');
        $('.box>img').attr('src',s)
        $(this).mousemove(function(e){
            let x=e.offsetX+20+$(this).position().left;
            let y=e.offsetY+20+$(this).position().top;
            $(this).parent().find('div').css('left',x).css('top',y);
        })
    })
    $('.container>img').mouseleave(function(){
        $(this).parent().find('div').fadeOut();
    })
</script>